﻿using System.Runtime.CompilerServices;

namespace eNets.IO.Binary;

static class BinaryBufferUtil
{
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static unsafe float Int32BitsToSingle(int value)
    {
        return *(float*)(&value);
    }
    
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static unsafe int SingleToInt32Bits(float value)
    {
        return *(int*)(&value);
    }
}